﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;


public partial class admin_Product_Categories : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {


        SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ShoppingOnlineConnectionString"].ConnectionString);
        string str = "insert into  ProductType (TypeProduct_ID,TypeProduct_Name)values(@id,@name)";
        SqlCommand cmd = new SqlCommand(str, conn);
        cmd.Parameters.Add("@id", txtCateID.Text);
        cmd.Parameters.Add("@name", txtCateName.Text);
        conn.Open();

        cmd.ExecuteNonQuery();

        gvLoaiSP.EditIndex = -1;
        gvLoaiSP.DataBind();
        gvLoaiSP.Visible = true;
        Response.Write("chuc mung ban da add thanh cong");
    }
   
}
